﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ControlCenter.ApplicationService;
using ControlCenter.Model;
using ControlCenter.Model.BizEntities;
using ControlCenter.Model.WebApiDto;
using Microsoft.AspNetCore.Mvc;
using MingYuanyun.WebApi.Abstractions;

namespace ControlCenterService.WebApi.Controllers
{
    /// <summary>
    /// 日志Api
    /// </summary>
    [Route("[controller]")]
    public class LogController : BasicController
    {
        private readonly ILogService _logService;

        /// <summary>
        /// 类初始化
        /// </summary>
        /// <param name="logService"></param>
        public LogController(ILogService logService)
        {
            _logService = logService;
        }

        /// <summary>
        /// 查询日志（使用者：控制中心）
        /// </summary>
        /// <returns>返回日志分页集合</returns>
        [HttpGet]
        [Route("query")]
        public async Task<HttpRequestResult<PagedData<LogQueryReturnDto>>> Query(LogQueryDto paramDto)
        {
            return OkHttpRequestResult(await _logService.Query(paramDto));
        }
    }
}
